<template>
    <div style="width:100%;height:100%;overflow:hidden auto">
        <weui-cell :list="cell_1_list">
        </weui-cell>
        <weui-cell :list="cell_0_list">
        </weui-cell>
    </div>
</template>

<script>
import WeuiCell from '../vue2componentSet/src/components/WeuiCell'
import global from '../lib/global'
import axios from 'axios'

export default {
    components: {
        WeuiCell
    },
    data() {
        return {
            cell_0_list: [],
            cell_1_list: [{
                value: '添加',
                link: '#/activityConfig'
            }]
        }
    },
    mounted() {
        this.$store.commit('set_title', 'activity list')

        axios.post(global.server + 'getActivityList.do', {}).then(result => {
            const obj = result.data
            if (obj.result == 1) {
                this.cell_0_list = []
                obj.activityList.forEach(item => {
                    this.cell_0_list.push({
                        value: item.name,
                        link: '#/activityConfig?activityId=' + item._id
                    })
                })
            } else if (obj.result == 0) {
                this.$router.goback()
            }
        }, result => {})
    }
}
</script>